#ifndef _typedefs_H_
#define _typedefs_H_

#define uLong32 unsigned long
#define uInt16 unsigned int
#define uInt8  unsigned char
#define NUL ((void *)0)



// Bit handling macros
//************************************************************************************
#define SETBIT(x,y) (x |= (y))          // Set bit y in byte x
#define CLRBIT(x,y) (x &= (~(y)))       // Clear bit y in byte x
#define CHKBIT(x,y) (x & (y))           // Check bit y in byte x

#define OR          ||
#define AND         &&

/* description A block of code may be made atomic by wrapping it with this
 macro.  Something which is atomic cannot be interrupted by interrupts */

#define ATOMIC(code)                      \
  {                                       \
    uInt8 em_isr_state;                   \
    em_isr_state = __save_interrupt();    \
    __disable_interrupt();                \
    do{ code }while(0);                   \
    __restore_interrupt( em_isr_state );  \
  }



extern void Reset_By_Watchdog(void);

#endif

